import { Component, OnInit, Inject, ChangeDetectionStrategy } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material';

@Component({
  selector: 'app-new-task',
  templateUrl: './new-task.component.html',
  styleUrls: ['./new-task.component.scss'],
  //ChangeDetectionStrategy.OnPush 不用检查当前组件树是否变化  除非 你告诉我  手动设置
  changeDetection:ChangeDetectionStrategy.OnPush
})
export class NewTaskComponent implements OnInit {
  title:string ="";
  priorities=[
    {
      label:'紧急',
      value:1
    },
    {
      label:'重要',
      value:2
    },
    {
      label:'普通',
      value:3
    },
  ]
  constructor(@Inject(MAT_DIALOG_DATA) private data) { }

  ngOnInit() {
    this.title = this.data.title;
    console.log(JSON.stringify(this.data))
  }

}
